package service

import "fmt"

func twoSum(nums []int, target int) []int {
	for i := 0; i < len(nums); i++ {
		for j := i + 1; j < len(nums); j++ {
			if i == j {
				continue
			}
			if nums[i]+nums[j] == target {
				return []int{i, j}
			}
		}
	}
	return []int{}
}

//func twoSumMap(nums []int, target int) []int {
//	mp := map[int]int{}
//	for i := 0; i < len(nums); i++ {
//		b := target - nums[i]
//		v, ok := mp[b]
//		if ok {
//
//		}
//	}
//	return []int{}
//}

func Map() {
	mp := map[string]int{}
	mp["a1"] = 1
	mp["a2"] = 1
	mp["a3"] = 1
	mp["a4"] = 1
	mp["a5"] = 1
	mp["a1"] = 2
	mp["a2"] = 3
	fmt.Println(mp)
}
